package com.wr.api.impl;

import com.wr.api.ApiMethod;
import org.apache.dubbo.common.URL;
import org.apache.dubbo.config.annotation.Service;

import java.util.Random;
import java.util.concurrent.TimeUnit;

/**
 * @author 王瑞
 * @description: TODO
 * @date 2020/4/16  14:30
 */
@Service
public class MethodImpl implements ApiMethod {

    static Random random = new Random();


    public String methodA(String name) {
        int i = random.nextInt(100)+1;

        try {
            TimeUnit.MILLISECONDS.sleep(i);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }


        return "Hello  A";
    }

    public String methodB(String name) {
        int i = random.nextInt(100)+1;

        try {
            TimeUnit.MILLISECONDS.sleep(i);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }


        return "Hello  B";
    }

    public String methodC(String name) {
        int i = random.nextInt(100)+1;

        try {
            TimeUnit.MILLISECONDS.sleep(i);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }


        return "Hello  C";
    }
}



